<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<input type="checkbox" id="ck"  />
		<hr />
		<div id="div">
			<input type="checkbox"/><br />
			<input type="checkbox" /><br />
			<input type="checkbox" /><br />
			<input type="checkbox" /><br />
			<input type="checkbox" />
		</div>
        <script>
           document.getElementById("ck").onclick= function(){
            //console.log(this.checked)
                let arrbox=document.getElementById("div");
                let box=arrbox.children
                for(let i=0;i<box.length;i++){
                    let box1=box[i]
                    box1.checked=this.checked
                }
            }
        </script>
	</body>
</html>
